//
//  JLHomeTitleButton.swift
//  新浪微博
//
//  Created by linlin on 15/11/26.
//  Copyright © 2015年 jilin. All rights reserved.
//

import UIKit

class JLHomeTitleButton: UIButton {

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    init(title: String) {
        
        super.init(frame: CGRectZero)
        
        setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        
        setTitle(title, forState: UIControlState.Normal)
        
        setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Normal)
        
        sizeToFit()
        
    }

    override func layoutSubviews() {
        
        super.layoutSubviews()
        
        titleLabel?.frame.origin.x = 0
        
        imageView?.frame.origin.x = titleLabel!.frame.width + 2
        
    }
    
    
    
    
    
}
